package com.sizu.entity;

import com.baomidou.mybatisplus.activerecord.Model;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.IdType;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.util.List;

/**
 * <p>
 * 
 * </p>
 *
 * @author Mht
 * @since 2020-02-22
 */
@Data
@Accessors(chain = true)
@TableName("t_menu")
public class TMenu extends Model<TMenu> {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
private Integer id;

    private String icon;
    @JsonProperty("label")
    private String name;

    private Integer state;

    private String url;

    @TableField("p_id")
    private Integer pId;

    private String path;

    private String component;
    @TableField(exist = false)
    private List<TMenu> children;

    @TableField(exist = false)
    private Integer menu_id;


    @Override
    protected Serializable pkVal() {
        return this.id;
    }

}
